import type { Config } from 'jest'

const config: Config = {
	preset: 'ts-jest/presets/js-with-ts',
	clearMocks: true,
	automock: false,
	resetMocks: false,
	testEnvironment: 'jsdom',
	moduleDirectories: ['node_modules', 'src'],
	rootDir: process.env.PWD,
	// moduleNameMapper: {
	// 	'\\.svg': '<rootDir>/src/__mocks__/svg.js',
	// },

	moduleNameMapper: {
		'\\.svg': '<rootDir>/src/__mocks__/svgrMock.tsx',
	},
	transform: {
		'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
			'<rootDir>/jest/fileTransformer.ts',
	},
	transformIgnorePatterns: ['node_modules'],
	setupFiles: ['<rootDir>/jest/setupJest.ts'],
}

export default config
